package cn.hl.hm.util;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
 * @author 大和
 * 
 * 返回码
 */
public class InfoCode {

	private int status;

	private String msg;

	private static final String DEFAULT_INFOCODE_MSG = "系统错误";

	public InfoCode(int status) {
		this.status = status;
		this.msg = DEFAULT_INFOCODE_MSG;
	}

	public InfoCode(int status, String msg) {
		this.status = status;
		this.msg = msg;
	}

	public static final InfoCode SUCCESS = new InfoCode(0, "成功");

	public static final InfoCode FAILURE = new InfoCode(1, "失败");
	public static final InfoCode VEHICLE_ERROR = new InfoCode(3005, "此车类型不存在");
	public static final InfoCode VEHICLE_ADD_ERROR = new InfoCode(3006, "此车类型配载费已添加");
	public static final InfoCode VEHICLE_LENGTH_ERROR = new InfoCode(3007, "长度已存在");
	public static final InfoCode VEHICLE_EXIXTS_ERROR = new InfoCode(3008, "车辆重复");
	public static final InfoCode MESSAGE_ERROR = new InfoCode(1001, "验证码不正确");
	public static final InfoCode REGIST_ERROR = new InfoCode(1002, "该用户已存在");
	public static final InfoCode RESET_ERROR = new InfoCode(1003, "该用户不存在");
	public static final InfoCode AUTH_ERROR = new InfoCode(1004, "用户名或密码错误");
	public static final InfoCode RFC_ERROR = new InfoCode(1005, "此账号已存在");
	public static final InfoCode SORTNUM_ERROR = new InfoCode(1006, "该值已存在");
	
	
	public static final InfoCode PARAM_ERROR = new InfoCode(4004, "请求参数错误");
	public static final InfoCode CAR_LINE_ERROR = new InfoCode(4005, "车辆路线信息错误");
	public static final InfoCode DRIVER_ERROR = new InfoCode(4006, "司机不满足接单条件");
	public static final InfoCode PUSH_ERROR = new InfoCode(4007, "推送参数不足");
	public static final InfoCode UPDATEORDER_ERROR = new InfoCode(4008, "只能修改未派订单");
	public static final InfoCode ORDER_STATUS_EMPTY_ERROR = new InfoCode(4009, "订单状态为空");
	public static final InfoCode ORDER_STATUS_ERROR = new InfoCode(4010, "不允许修改订单支付状态");
	public static final InfoCode USER_UNFINASH = new InfoCode(4011, "用户有未完成订单，不能下单");
	public static final InfoCode ORDER_GIVEDRIVER_ERROR = new InfoCode(4012, "订单非待打款与待点评状态不能打款");
	public static final InfoCode CANCLE_CONDITON = new InfoCode(4013, "只能取消未派发的订单");
	public static final InfoCode CLOSE_CONDITON = new InfoCode(4014, "只有订单状态为1：待接单2：待付款（已接单）3：待送达（已付款）4:待点评 时可以关闭");
	public static final InfoCode DRIVER_BALANCE_ERROR = new InfoCode(4015, "司机余额不足");
	public static final InfoCode DRIVER_EXIXTS_ERROR = new InfoCode(4016, "该司机不存在");
	public static final InfoCode DRIVER_REMAIN_ERROR = new InfoCode(4016, "该司机余额不足");
	public static final InfoCode DRIVER_GIFT_ERROR = new InfoCode(4017, "已充过");
	public static final InfoCode UNDO = new InfoCode(4018, "您有退款未处理，暂不能申请退款");
	public static final InfoCode DRIVER_WITHDRAWCASH_ERROR = new InfoCode(4019, "可取现金额不足");
	public static final InfoCode DRIVER_PAY_RESTRICTION_ERROR = new InfoCode(4020, "同一车牌号在2小时内不可多次扣费");
	
	public static final InfoCode ORDER_RECIVICE_USER_ERROR = new InfoCode(4016, "只有待送达和待点评的订单才能更改");

	/**
	 * 2*** 为支付状态码
	 */
	public static final InfoCode PAY_METHOD_ERROR = new InfoCode(2001, "支付方式不存在");
	public static final InfoCode PAY_HANDLER_ERROR = new InfoCode(2002, "无可用支付handler");
	public static final InfoCode PAIED_ERROR = new InfoCode(2003, "重复支付");
	public static final InfoCode PAY_TIME_ERROR = new InfoCode(2004, "未派订单无法支付");
	public static final InfoCode PAY_ORDER_ERROR = new InfoCode(2005, "订单不存在");
	public static final InfoCode PAY_OK_UPDATE_ERROR= new InfoCode(2006, "支付成功，更新数据失败");


	
	
	
	public int getStatus() {
		return status;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}


}
